import requests
from bs4 import BeautifulSoup
first_url = 'https://movie.douban.com/subject/26322642/'
# 请求头部
headers = {
  'Host':'movie.douban.com',
  'Referer':'https://movie.douban.com/subject/24753477/?tag=%E7%83%AD%E9%97%A8&from=gaia_video',
  'Upgrade-Insecure-Requests':'1',
  'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36',
}
def visit_URL(url):
  res = requests.get(url=url,headers=headers)
  soup = BeautifulSoup(res.content,'html5lib')
  info=soup.find(id='info')
  p1=info.find(class_='pl')
  dy=p1.next_sibling.next_sibling.a.get_text()
  print(dy)
  summary=soup.find(property='v:summary').get_text()
  print(summary)
  #评分
  pf=soup.find(property="v:average").get_text()
  # 短评
  # 影评
  # 讨论区
def duanping_url(url):
    url='https://movie.douban.com/subject/30447123/comments?status=P'
def yinpin(url):
    url='https://movie.douban.com/subject/30447123/reviews'
def dicurl(url):
    url='https://movie.douban.com/subject/30447123/discussion/' # 讨论区
if __name__ == '__main__':
  visit_URL(first_url)